/***
 * 表格信息内容
 *  1:是否显示分页
 *  2.是不是显示查询
 *  3.表格配置
 *  4.表单配置
 *  4.this.$uri.peis.fuFollowup
 */

import apiUrl from '@/api/apiUrl'
const tableConfig = {
  //导入
  importRequst: {
    url: apiUrl.system.importSystem
  },
  //导出
  exportReust: {
    url: apiUrl.system.exportSystem
  },
  //增加
  addRequest: {
    url: apiUrl.system.addSystem,
    transformParams: (res: object) => {
      console.log(res, '===============增加成功有======================')
      return res
    }
  },
  deleteRequest: {
    url: apiUrl.system.deleteSystem,
    data: {
      ids: ''
    }
  },
  //更新
  updateRequest: {
    url: apiUrl.system.updateSystem,
    transformParams: (res: object) => {
      return res
    }
  },
  // 获取
  getRequest: {
    url: apiUrl.system.getSystemList,
    async: true,
    data: {
      name: 'dogface'
    },
    transformParams: (res: object) => {
      return res
    }
  },
  pagination: {
    //分页设置
    currentPage: 4,
    show: true
    // pageSizes: [100, 400, 500]
  },
  operation: {
    //按钮设置
    show: true,
    columnList: [
      {
        type: 'info',
        name: '打印',
        size: 'small',
        value: 'print',
        icon: 'DataBoard',
        show: true
      }
    ],
    on: {
      handler: (item: object) => {
        console.log(item, '============================自定义事件处理')
      }
    }
  },
  data: [
    {
      chiefExamDate: '2016-05-03',
      name: 'Tom',
      state: 'California',
      updateByName: 'Los Angeles',
      purpose: 'No. 189, Grove St, Los Angeles',
      sexName: 'CA 90036'
    }
  ],
  selectionRow: true,
  stripe: true,
  border: false,
  rowDel: true,
  rowEdit: true,
  rowLook: true,
  tableEdit: true, //表格是否可以编辑
  rowHandle: {
    //设置单行操作
    width: 250,
    settings: true,
    columns: {
      label: '操作',
      fixed: 'right',
      prop: 'right'
    },
    customButtons: [
      {
        type: 'warning',
        name: '分享',
        size: 'small',
        value: 'Share',
        icon: 'Share'
      }
    ],
    on: {
      handler: (item: object) => {
        console.log(item, '============================自定义事件处理')
      }
    }
  },
  indexRow: {
    label: '序号',
    width: 54
  },
  columns: [
    { label: '编号', prop: 'id', sortable: true },
    { label: '头像', prop: 'img', type: 'img' },
    { label: '姓名', prop: 'name' },
    { label: '性别', prop: 'sex', dictName: 'dictSex' },
    { label: '电话', prop: 'phoneNumber' },
    { label: '年龄', prop: 'age' },
    { label: '地址', prop: 'address', showOverflowTooltip: true },
    {
      label: '日期',
      prop: 'time',
      type: 'datePicker',
      width: '320px',
      components: {
        type: 'date',
        size: 'small',
        placeholder: '请选择日期'
      }
    },
    { label: '邮箱', prop: 'email' },
    {
      label: '随访方式',
      prop: 'time',
      showOverflowTooltip: true
    },
    {
      label: '随访次数',
      prop: 'time',
      showOverflowTooltip: true
    },
    { label: '随访状态', prop: 'status', showPopover: true },
    {
      label: '随访目的',
      prop: 'content',
      width: '400px'
    },
    {
      label: '随访结果',
      prop: 'result',
      showOverflowTooltip: true
    }
  ]
}

export default tableConfig
